<?php
require_once('bootstrap.php');
require_once('auth.php'); //require logged in

//database connect
$host="localhost"; // Host name 
$username="root"; // Mysql username     
$password="Bs377184"; // Mysql password 
$db_name="UDC"; // Database name 
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

//Function prints a div with all the links
function generateLinksDiv(){
    echo '<div id="linkMenu"> <p>Main Menu</p><ul>';
    echo '<li><a href="members.php">Member Home</a></li>';
    echo '<li><a href="savings.php">My Savings</a></li>';
    echo '<li><a href="memberTrends.php">My Spending Trends</a></li>';
    echo '<li><a href="logout.php">Log out</a></li>';
    echo '</ul></div>';    
}

function generateHeader(){
    echo '<div id="headerDiv">';
    echo '<p>Placeholder for common header</p>';  
    echo '</div>';   
}

function generateFooter(){
    echo '<div id="footerDiv">';
    
    echo '<p>this is the footer placeholder</p>';   
    
    echo '</div>';   
}


?>

<html>
    <head>
        <link href="css/styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <?php generateHeader();     //include common header?>
        <div id="container">
        <h1>How am I spending?e</h1>
            <?php generateLinksDiv()    //include common linkMenu;?>
            <div id="content">
                <!--Module goes in here -->
            </div>
            <?php generateFooter();     //include common footer?>
        </div>
    </body>
</html>